<?php
/**
 * Created by dwf.
 * Time: 2021/4/15 22:00
 */

namespace App\Http\Validate\Admin\Mutual;

use App\Http\Validate\BaseValidate;

class AlarmRuleV extends BaseValidate
{
    public function add()
    {
        return [
            'rule'           => [
                'title'        => 'required|string|unique:App\Models\Mutual\AlarmRuleModel,title',
                'type'         => 'required|integer',
                'mutual_types' => 'required|array',
                'mutual_state' => 'required|integer',
                'timeout'      => 'required|integer',
            ],
            'custom_message' => [
                'title.required' => '规则名称不能为空',
                'title.unique'   => '规则名称已存在',
            ]
        ];
    }

    public function edit()
    {
        return [
            'rule'           => [
                'id'           => 'required|integer',
                'title'        => 'required|string',
                'type'         => 'required|integer',
                'mutual_types' => 'required|array',
                'mutual_state' => 'required|integer',
                'timeout'      => 'required|integer',
            ],
            'custom_message' => [
                'title.required' => '规则名称不能为空',
            ]
        ];
    }

    public function changeStatus()
    {
        return [
            'rule' => [
                'id'     => 'required|integer',
                'status' => 'required|integer'
            ]
        ];
    }

    public function del()
    {
        return [
            'rule' => [
                'id' => 'required|integer'
            ],
        ];
    }
}